<template>
  <div class="col-md-8">
    <h3 class="reply">评论回复：</h3>
    <h2 v-show="comments.length===0">暂无评论，点击左侧添加评论！！！</h2>
    <ul class="list-group">
      <Item v-for="(comment, index) in comments" :key="index" :comment="comment" :deleteComment="deleteComment" :index="index"/>
      <!-- 使用:comment传入到子组件中 deleteComment则继续向下传递到子组件-->
    </ul>
  </div>
</template>

<script>
  import Item from './Item'
  export default {
    name: 'List',
    components: {
      Item
    },
    props: ['comments', 'deleteComment'],// 接受从父类组件传递过来的值
    data () {
      return {

      }
    }
  }

</script>

<style scoped>

.reply {
  margin-top: 0px;
}

</style>
